﻿using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shiloh.Job.Common.Helper
{
    public class EncryptHelper
    {
        public static string Mistake(string preString)
        {
            int i;
            preString = preString.Trim();
            int length = preString.Length;
            int seed = length;

            VBMath.Randomize(length);

            string texts = " ";
            for (i = 0; i < length; i++)
            {
                seed = (int)(94 * VBMath.Rnd(-(int)preString[i] - seed * (int)preString[length - 1]) + 32);
                texts = texts + (char)seed + (char)(94 * VBMath.Rnd(-seed) + 32);
            }
            string dist = " ";

            for (i = 0; i < texts.Length; i++)
            {
                if (!texts[i].Equals("'"))
                {
                    dist = dist + texts[i];
                }
            }
            return dist.Trim();
        }
    }
}
